package java虚拟机.虚拟机执行;

/**
 * @author juntao zhang
 */
public class DynamicDispatch {

  public static class Human {

    void hi() {
      System.out.println("human");
    }
  }

  public static class Man extends Human {

    void hi() {
      System.out.println("Man");
    }
  }

  public static class Woman extends Human {

    void hi() {
      System.out.println("Woman");
    }
  }

  public static void main(String[] args) {
    Human human = new Woman();
    human.hi();
  }
}
